class Solution {
public:
    // 比较函数
    static bool compare(const pair<int, int>& a, const pair<int, int>& b) {
        return a.second > b.second; // 降序排序
    }
    vector<string> findRelativeRanks(vector<int>& score) 
    {
       vector<pair<int,int>> per;
       for(int i = 0;i<score.size();i++)
       {
            per.push_back(make_pair(i,score[i]));
       }
       sort(per.begin(),per.end(),Solution::compare);
       vector<string> ret;
       ret.resize(score.size());
        if(per.size()>=1)
            ret[per[0].first] = "Gold Medal";
        if(per.size()>=2)
            ret[per[1].first] = "Silver Medal";
        if(per.size()>=3)
            ret[per[2].first] = "Bronze Medal";
        // 从第四名开始
        for (int i = 3; i < per.size(); i++) {
            ret[per[i].first] = to_string(i + 1); // 使用 to_string 进行转换
        }
       return ret;
    }
};